package com.hzlj.position.locate.common.enums;

import com.fz.common.base.exception.PubError;
import com.fz.common.base.exception.PubException;
import lombok.Getter;

@Getter
public enum PositionSysCheck {
    ING("0", "核查中"),
    SUCCESS("1", "核查正常"),
    FAIL("2", "核查异常"),
    NOT_REPORT("3", "越界未上报"),
    ;

    private final String check;
    private final String text;

    PositionSysCheck(String check, String text) {
        this.check = check;
        this.text = text;
    }


    public static PositionSysCheck of(String check) {
        for (PositionSysCheck sysCheck : values()) {
            if (sysCheck.name().equalsIgnoreCase(check)) {
                return sysCheck;
            }
        }
        throw new PubException(PubError.PARAM_EMPTY_ERROR);
    }
}
